package com.linked.pay.pay.bean.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linked.pay.pay.bean.dto.PayLogDTO;

/**
 * @author :dbq
 * @date : 2023/3/2 15:05
 * @description : desc
 */
@TableName("pay_pay_log")
public class PayLogPO {
    @TableId(value = "pay_log_id", type = IdType.ASSIGN_UUID)
    private String payLogId;
    @TableField("pay_id")
    private String payId;
    @TableField("order_id")
    private String orderId;

    /**
     * 支付状态。1、创建；2、支付；3、取消；4、退款
     */
    @TableField("log_status")
    private Integer logStatus;
    @TableField("method_value")
    private String methodValue;
    @TableField("remarks")
    private String remarks;
    @TableField("user_id")
    private String userId;
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String createTime;

    public PayLogPO(PayLogDTO data) {
        this.payId = data.getPayId();
        this.logStatus = data.getLogStatus();
        this.orderId = data.getOrderId();
        this.methodValue = data.getMethodValue();
        this.userId = data.getUserId();
        this.remarks = data.getRemarks();
    }
}
